import{u as s}from"../utils.js";const e="h-loading";let l=null;function a(i=""){if(l)l.querySelector(`.${e}-text`).innerText=i,s.addClass(l,`${e}-loading`),s.addClass(l,`${e}-visible`);else{let n=`<div class="${e} ${e}-full-screen">
      <div class="${e}-circular">
        <svg viewBox="25 25 50 50">
          <circle cx="50" cy="50" r="20" fill="none" class="circle"></circle>
        </svg>
        <p class="${e}-text">${i}</p></div>
      </div>
    </div>`,d=window.document.createElement("div");d.innerHTML=n,l=d.childNodes[0],document.body.appendChild(l),setTimeout(()=>{s.addClass(l,`${e}-loading`),s.addClass(l,`${e}-visible`)},10)}}function o(i){a(i)}o.close=()=>{l&&(s.removeClass(l,`${e}-loading`),setTimeout(()=>{s.removeClass(l,`${e}-visible`)},500))};o.open=i=>{a(i)};export{o as default};
